<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>重庆大学硕士研究生服务系统</title>
<?php $this->load->view('includes/ga_head'); ?>  
</head>
<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> 
<body class=""> 
<!--<![endif]-->
<?php $this->load->view('includes/ga_navbar'); ?>  
<?php $this->load->view('includes/ga_sidebar'); ?>  
<div class="content">
    <div class="header">
        <h1 class="page-title">用户列表</h1>
    </div>
    <ul class="breadcrumb">
            <li><a href="index.html">Home</a> <span class="divider">/</span></li>
            <li><a href="<?php echo $base_url;?>gass_auth_teachers/manage_user_accounts">用户列表</a> <span class="divider">/</span></li>
            <li class="active">用户资料</li>
    </ul>
    <div class="container-fluid">
        <div class="row-fluid">
<?php $this->load->view('includes/ga_message'); ?>  
<?php echo form_open(current_url());?>  	
<input type="hidden" name="upro_id" value=<?php echo $user['uacc_id'];?> />
<input type="hidden" name="original_email" value=<?php echo $user['uacc_email'];?> />
<input type="hidden" name="original_upro_college" value=<?php echo $user['upro_college_id'];?> />
<div class="btn-toolbar">
  <input type="submit" value="保存" name="update_form_submit" class="btn btn-primary" /><i class="icon-save"></i>
  <div class="btn-group">
  </div>
</div>
<div class="well">
        <label>姓</label>
		<input type="text" class="span4" name="upro_first_name" value="<?php echo set_value('upro_first_name',$user['upro_first_name']);?>" />
        <label>名</label>
		<input type="text" class="span4" name="upro_last_name" value="<?php echo set_value('upro_last_name',$user['upro_last_name']);?>" />
        <label>Email Address</label>
		<input type="text" class="span4" name="upro_email" value="<?php echo set_value('upro_email',$user['uacc_email']);?>" />
        <label>电话</label>
        <input type="text" class="span4" name="upro_phone" value="<?php echo set_value('upro_phone',$user['upro_phone']);?>" />
        <label>角色</label>
        <select id="upro_group_id" name="upro_group" class="span4">
			    	<?php foreach ( $groups as $group ){ ?>
			    	<option value = <?php echo $group['ugrp_id']; ?> <?php echo ($group['ugrp_id']==$user['ugrp_id'])?'selected':''; ?> ><?php echo $group['ugrp_name']; ?></option>
			    	<?php } ?>
		</select>
		<div id='college_chose' <?php echo ($user['ugrp_id']==2)?"":"style='display:none'" ?>>
        <label>所属学院</label>
        <select id="upro_college_id" name="upro_college" class="span4">
			    	<?php foreach ( $colleges as $college ){ ?>
			    	<option value = <?php echo $college['college_id']; ?> <?php echo ($college['college_id']==$user['upro_college_id'])?'selected':''; ?> ><?php echo $college['college_name']; ?></option>
			    	<?php } ?>
	    </select>
	    </div>
</div>
	  <?php echo form_close();?>
<?php $this->load->view('includes/ga_footer'); ?>  
        </div>
    </div>
</div>
<?php $this->load->view('includes/ga_scripts'); ?>
<script>  
$(document).ready(function(){
//只有招生学院老师角色才可以选择学院信息 
$('#upro_group_id').change(function(){
	switch ($('#upro_group_id').val()){
		case '2':
		  $('#college_chose')[0].style.display='';
		  break;
		default:
		  $('#college_chose')[0].style.display='none';
		  break;
	}
});

});
</script>
</body>
</html>
